[Infra] - ci/cd, ec2, alb, mysql, logging, monitoring, nginx#5
[Infra] - ci/cd, ec2, alb, mysql, logging, monitoring, nginx#5
Conversation
Test Results1 tests 1 ✅ 0s ⏱️ Results for commit 7615f0e. ♻️ This comment has been updated with latest results. |
kargowild
left a comment
There was a problem hiding this comment.
+) file changed에 없어서 코멘트를 못 달았는데,
internal의 application.yml 에서 #local profile에 해당하는 내용은 어떤 역할인가요? 현재 필요없는 상태가 맞을까요?!
| jobs: | ||
| detect-changes: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| api_changed: ${{ steps.filter.outputs.api }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - id: filter | ||
| uses: dorny/paths-filter@v3 | ||
| with: | ||
| filters: | | ||
| api: | ||
| - 'api/**' |
There was a problem hiding this comment.
internal, api용 브랜치를 나누지 않기로 했으니, 이전에 논의했던 대로 파일 변경이 생긴 경우에만 trigger되도록 cd 파일을 분리했습니다.
찾아보니까 특정 폴더에 파일 변경이 생겼는지 알아보기 위해 dorny/paths-filter라는 액션을 많이 사용하길래 적용해봤습니다!
There was a problem hiding this comment.
오 확정이었을까요??
전에 말씀드린 것처럼 dev -> prod 로 merge 될때 각 모듈이 따로 배포 될 수 있도록 조절이 가능한 것일까요?
There was a problem hiding this comment.
아 그 부분을 놓치고 구현했네요 😅
예를 들어 develop에는 api, internal 변경사항이 모두 생겼는데 api만 배포하고 싶은 상황 말씀하시는 거 맞을까요?
저번에 질문 드리다가 정리가 안됐었는데, 이 부분을 멘토님께 정리해서 질문드려봐야 할 것 같네요!!
이거 혹시 좀 더 구체적인 상황을 예시들어주실 수 있나요? 제가 좀 헷갈려서요 ㅠ
| outputs: | ||
| api_changed: ${{ steps.filter.outputs.api }} |
There was a problem hiding this comment.
이게 변수처럼 사용돼서 아래 build-api를 돌릴지 말지 결정하게 됩니다.
| username: ${{ secrets.DOCKER_USERNAME }} | ||
| password: ${{ secrets.DOCKER_PASSWORD }} |
There was a problem hiding this comment.
네네 좋습니다!! 이슈, PR 템플릿도 organization 기준으로 설정 가능하던데, 고것도 한번 참고해서 적용하면 좋을 거 같네요!
| expose: | ||
| - 8080 |
There was a problem hiding this comment.
모든 컨테이너에서 expose 적극 활용했습니다. 모듈마다 포트번호 따로 지정해주는게 번거로울 것 같아서요!
| restart: always | ||
| environment: | ||
| TZ: Asia/Seoul | ||
| MYSQL_USER: ${SPRING_DATASOURCE_USERNAME_DEV} |
There was a problem hiding this comment.
헷갈리는게 ${SPRING_DATASOURCE_USERNAME_DEV} 이거 우리 kokomen으로 쓰고 있었나요 root로 쓰고 있었나요? 일단 root로 해서 잘 돌아가는 것까진 확인했습니다
| networks: | ||
| - dev-kokomen-net | ||
|
|
||
| notification-mysql-dev-exporter: |
There was a problem hiding this comment.
prometheus는 kokomen-backend의 docker compose에서 돌리고 있어서, 거기서 위 exporter도 바라보도록 수정해줬습니다. (PR만 올라간 상태)
도커네트워크를 싹다 연결해놔서 아마 잘 찾아갈 것 같습니다!
| run: | | ||
| export HOSTNAME=$(hostname) | ||
| cd kokomen-notification/docker/dev | ||
| sudo -E docker compose -f docker-compose-dev.yml up -d kokomen-notification-dev-internal |
There was a problem hiding this comment.
-d 뒤에 애플리케이션 컨테이너만 실행하도록 구체적으로 명시했습니다
| activate: | ||
| on-profile: dev | ||
| datasource: | ||
| url: jdbc:mysql://kokomen-notification-mysql-dev:3306/kokomen-notification-dev |
There was a problem hiding this comment.
이거 이렇게 컨테이너 이름으로 박아놔도 되겠죠?
kokomen-backend에서는 이걸 왜 시크릿으로 관리했었는지 기억이 잘 안나네요
nak-honest
left a comment
There was a problem hiding this comment.
브랜치 쪼개는 쪽 이야기 한번 더 해보고 merge 시키면 좋을 것 같아 일단 comment로 남겨드려요!
고생 많으셨습니다~!!
| jobs: | ||
| detect-changes: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| api_changed: ${{ steps.filter.outputs.api }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - id: filter | ||
| uses: dorny/paths-filter@v3 | ||
| with: | ||
| filters: | | ||
| api: | ||
| - 'api/**' |
There was a problem hiding this comment.
오 확정이었을까요??
전에 말씀드린 것처럼 dev -> prod 로 merge 될때 각 모듈이 따로 배포 될 수 있도록 조절이 가능한 것일까요?
| username: ${{ secrets.DOCKER_USERNAME }} | ||
| password: ${{ secrets.DOCKER_PASSWORD }} |
There was a problem hiding this comment.
네네 좋습니다!! 이슈, PR 템플릿도 organization 기준으로 설정 가능하던데, 고것도 한번 참고해서 적용하면 좋을 거 같네요!
.github/workflows/ci-api-test.yml
Outdated
| if: always() | ||
| with: | ||
| report_paths: ${{ github.workspace }}/api/build/test-results/**/*.xml | ||
| token: ${{ github.token }} No newline at end of file |
| restart: always | ||
| environment: | ||
| TZ: Asia/Seoul | ||
| MYSQL_USER: ${SPRING_DATASOURCE_USERNAME_DEV} |
| activate: | ||
| on-profile: dev | ||
| datasource: | ||
| url: jdbc:mysql://kokomen-notification-mysql-dev:3306/kokomen-notification-dev |
현재는 내용이 비어있고 domain 모듈의 로컬 프로파일을 가져오고 있어서 아무 역할을 안하고 있습니다! 처음에는 내용이 따로 있다보니 따라온 거였어요! |

Uh oh!
There was an error while loading. Please reload this page.